Skip to content

feat(bench): add Playwright-based benchmark harness and migrate scenarios from fast-element#7267

Merged
janechu merged 6 commits intomainfrom
users/radium-v/benchmark-harness
Feb 13, 2026
Merged

feat(bench): add Playwright-based benchmark harness and migrate scenarios from fast-element#7267
janechu merged 6 commits intomainfrom
users/radium-v/benchmark-harness

Conversation

@radium-v
Copy link
Collaborator

Pull Request

📖 Description

Introduces a new benchmark package with a Playwright + Chrome DevTools trace-based benchmarking harness, replacing the previous @tensile-perf/web-components setup embedded in fast-element.

Benchmark scenarios (basic, observable, render, repeat-reverse, repeat-shift, when-basic, when-conditional, when-switch) have been migrated from inline .bench.ts files in fast-element to standalone suites under the new packages/bench package. Each suite runs in a real browser via Playwright, collects trace data through CDP, and reports timing stats (min/median/mean/p95/max) for scripting, layout, style recalc, and paint.

Also adds @types/parse5 as a dev dependency for fast-ssr to fix the build.

👩‍💻 Reviewer Notes

  • The bench package is private: true and not published — it's a dev-only tool for local and CI performance testing.
  • Benchmarks can be run against the Vite dev server (npm run test) or a production build (BENCH_DIST=true npm run test).
  • The server/ subdirectory is a self-contained static file server for serving the Vite build output.

📑 Test Plan

  • Run npm run test -w @microsoft/fast-bench (or cd packages/bench && npm run test) to execute the benchmark suite locally and confirm output tables print correctly.
  • Run npm run build -w @microsoft/fast-ssr to verify the @types/parse5 fix resolves the build error.
  • All existing tests should continue to pass.

✅ Checklist

General

  • I have included a change request file using $ npm run change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

⏭ Next Steps

  • Add a CI pipeline step to run benchmarks on PRs for regression detection.
  • Investigate baseline recording and comparison for automated performance regression alerts.

…ement package

- Deleted the benchmark script `run-benchmarks.js` and its associated configurations.
- Removed utility functions and data generation logic from `utilities.ts`.
- Eliminated benchmark test files related to observable, rendering, and templating.
- Cleaned up package.json by removing unused dependencies and scripts.
- Introduced a new benchmark suite for testing various FAST element functionalities.
- Created multiple benchmark scenarios including basic rendering, observable properties, repeat directives, and conditional rendering.
- Implemented a harness for running benchmarks and collecting performance metrics using CDP tracing.
- Added HTML and TypeScript files for each benchmark scenario, ensuring a comprehensive testing approach.
- Included utilities for generating random data and managing DOM trees for benchmarks.
- Configured Vite for building and serving the benchmark suite.
@radium-v radium-v self-assigned this Feb 13, 2026
@janechu janechu merged commit 65f87c8 into main Feb 13, 2026
8 checks passed
@janechu janechu deleted the users/radium-v/benchmark-harness branch February 13, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants